Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web-analytics): Session filters 1 #21512

Merged
merged 32 commits into from
Apr 25, 2024
Merged

feat(web-analytics): Session filters 1 #21512

merged 32 commits into from
Apr 25, 2024

Conversation

robbie-c
Copy link
Member

@robbie-c robbie-c commented Apr 12, 2024

Problem

Need session filters for web analytics and personless events

Screenshot 2024-04-24 at 14 00 04 Screenshot 2024-04-24 at 14 00 10 Screenshot 2024-04-24 at 14 00 21 Screenshot 2024-04-24 at 14 00 45

Changes

Make it work

  • Can query using session property filters in event scope and session scope in hogql
  • Can fetch session property filters in TaxonomicFilter UI
  • Can fetch session property values in TaxonomicFilter UI
  • Each session property filter has an entry in Taxonomy.ts
  • Existing tests pass or are updated to pass

Make it right

  • Taxonomy.ts entires are fully formed, with nice descriptions and examples
  • Good error message if you try to use a session filter where it isn't valid (i.e. not hogql)
  • Test coverage for the new functions to get properties and values
  • Only visible in web analytics (for now) and only with a FF

Make it fast

  • Query the property values from raw sessions rather than needing to aggregate anything

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Tests are part of my checklist above

Copy link
Contributor

github-actions bot commented Apr 12, 2024

Size Change: +488 B (0%)

Total Size: 1.04 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.04 MB +488 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from de71718 to 9566ea4 Compare April 15, 2024 20:58
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from 6ef03ae to 61948ce Compare April 16, 2024 10:16
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from 1c824af to 6a06696 Compare April 16, 2024 20:15
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from d0f8936 to 4ae265f Compare April 16, 2024 21:24
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch 2 times, most recently from e59e073 to 23054b5 Compare April 18, 2024 12:41
@robbie-c robbie-c marked this pull request as ready for review April 18, 2024 12:42
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from 4b6dcc6 to 7ec47f6 Compare April 18, 2024 13:35
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@robbie-c robbie-c force-pushed the feat/session-filters-1 branch from 9f2cf28 to 0ec3bf1 Compare April 25, 2024 08:56
@robbie-c robbie-c requested a review from a team April 25, 2024 08:56
Copy link
Collaborator

@mariusandra mariusandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read through the code and looks good. Ran and everything worked. So here's a ✅ from me.

A future improvement would be to add these session properties to even more places, like the Activity page, person pages, etc. (Groups should also be added to more places now)

Comment on lines +1219 to +1234
sessions: {
async propertyDefinitions({
teamId = ApiConfig.getCurrentTeamId(),
search,
properties,
}: {
teamId?: TeamType['id']
search?: string
properties?: string[]
}): Promise<CountedPaginatedResponse<PropertyDefinition>> {
return new ApiRequest()
.sessionPropertyDefinitions(teamId)
.withQueryString(toParams({ search, ...(properties ? { properties: properties.join(',') } : {}) }))
.get()
},
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pagination?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably no need to add it to the definitions endpoint, but I should add it to the values endpoint. I'll fix this in a future PR

@robbie-c robbie-c merged commit e3acb16 into master Apr 25, 2024
106 checks passed
@robbie-c robbie-c deleted the feat/session-filters-1 branch April 25, 2024 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants